package com.qutan.app.core.domain.enumclass;

/**
 * Created by pwy on 15-4-17.
 * 性别枚举
 */
public enum SexType {
    FEMALE("女", 0), MALE("男", 1), OTHER("其他", 2);

    SexType(String text, int sort) {
        this.text = text;
        this.sort = sort;
    }

    private int sort;
    private String text;

    public String getText() {
        return text;
    }

    public void setText(String text) {
        this.text = text;
    }

    public int getSort() {
        return sort;
    }

    public void setSort(int sort) {
        this.sort = sort;
    }

    public static SexType getSexTypeByFlag(int flag){
        if(flag==SexType.FEMALE.getSort()){
            return SexType.FEMALE;
        }else if(flag==SexType.MALE.getSort()){
            return SexType.MALE;
        }else if(flag==SexType.OTHER.getSort()){
            return SexType.OTHER;
        }else{
            return null;
        }
    }
}
